<nz-tabset
  #tabset
  [nzSelectedIndex]="pos"
  [nzAnimated]="false"
  [nzType]="tabType"
  [nzTabBarExtraContent]="tabBarExtraContent"
  [nzTabBarGutter]="tabBarGutter"
  [nzTabBarStyle]="tabBarStyle"
>
  <nz-tab *ngFor="let i of list; let index = index" [nzTitle]="titleTemplate" (nzClick)="_to(index)">
    <ng-template #titleTemplate>
      <div
        [reuse-tab-context-menu]="i"
        [customContextMenu]="customContextMenu"
        class="reuse-tab__name"
        [attr.title]="i.title"
      >
        <span [class.reuse-tab__name-width]="tabMaxWidth" [style.max-width.px]="tabMaxWidth">
          <ng-container
            *ngIf="titleRender; else defaultTitle"
            [ngTemplateOutlet]="titleRender"
            [ngTemplateOutletContext]="{ $implicit: i }"
          ></ng-container>
          <ng-template #defaultTitle>{{ i.title }}</ng-template>
        </span>
      </div>
      <i *ngIf="i.closable" nz-icon nzType="close" class="reuse-tab__op" (click)="_close($event, index, false)"></i>
    </ng-template>
  </nz-tab>
</nz-tabset>
<reuse-tab-context [i18n]="i18n" (change)="contextMenuChange($event)"></reuse-tab-context>
